import {hashHistory, IndexRoute, Route, Router} from 'react-router';
import AsyncComponent from './../components/Bundle/index.js';
import App from '../layout/App';

// 获取到异步组件
const workType = AsyncComponent(() => import('pages/WorkType'));
const workGantt = AsyncComponent(() => import('pages/WorkGantt'));
const workFile = AsyncComponent(() => import('pages/WorkFile'));
const workProduct = AsyncComponent(() => import('pages/WorkProduct'));
const workProblemReason = AsyncComponent(() => import('pages/WorkProblemReason'));

const Routers = (
  <Router history={hashHistory}>
    <Route exact path="/" component={App}>
      <IndexRoute component={workType} />
      <Route path="/worktype" component={workType}/>
      <Route path="/workgantt" component={workGantt}/>
      <Route path="/workfile" component={workFile}/>
      <Route path="/workproduct" component={workProduct}/>
      <Route path="/workproblemreason" component={workProblemReason}/>
    </Route>
  </Router>
);


export default Routers
